<%-- 
    Document   : beanpage
    Created on : Aug 6, 2010, 5:40:49 PM
    Author     : nguyenquang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript">
            function isNumberKey(evt)
            {
                var charCode = (evt.which) ? evt.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57))
                {
                    return false;
                }
                return true;
            }
        </script>
    </head>
    <body>
        <h3 align="center">Welcome to shop DVD</h3>
        <jsp:useBean id="id" scope="session" class="newpackage.DVDShop"/>
        <jsp:setProperty name="id" property="*"/>

        <form action="product.jsp" method="post">
            <p align="center">They want to offer a discount of 5%, if customer buy or rent 5 or more items</p>
            <hr style="color:#ff0000;">
            <table align="center">
                <tr>
                    <td>Quantity: </td>
                    <td><input type="text" name="quantity" onkeypress="return isNumberKey(event)"/></td>
                    <td><input type="submit" value="Caculate"/></td>
                </tr>

                <tr>
                    <td>Discount: </td>
                    <td><jsp:getProperty name="id" property="total"/>$</td>                  
                </tr>
            </table>
        </form>
    </body>
</html>
